﻿<%@ Page Language="C#" MasterPageFile="~/Member/UserManage.master" EnableEventValidation="false"
    AutoEventWireup="true" CodeFile="Certificate.aspx.cs" Inherits="member_Certificate_Certificate"
    Title="证书管理" %>

<%@ Register Src="../../Control/PageNo.ascx" TagName="PageNo" TagPrefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContInfo" runat="server">

    <script type="text/ecmascript">
        function SelectAll()
        {
            // 找到所有的 input 元素
            var ctllist = document.getElementsByTagName("input");
            var objcheckbox= document.getElementById("CheckBox2");     
            for( var i = 0; i< ctllist.length; i++)
            {
                if(ctllist[i].type == "checkbox" && ctllist[i].name.indexOf( "CheckBox1") >=0 )
                {   
                    if(objcheckbox.checked==true)     
                         ctllist[i].checked = true;
                    else
                         ctllist[i].checked = false;
                }
          
             }
         }
    </script>
    <div class="inkg mar_top">
    <form id="form1">
            <strong class="inkgt">
                证书管理</strong>
            <div class="intip mar_top">
                <strong class="intipt">提&nbsp;示：</strong>·在管理证书时候请您慎重选择是否删除！
            </div>
            <div class="inso mar_top">
              <table border="0" cellpadding="0" cellspacing="0" width="510">
                <tr>
                    <td>
                        公司名称：<asp:TextBox ID="txtCompany" runat="server"></asp:TextBox>&nbsp;证书名称：<asp:TextBox
                            ID="txtCertificateName" runat="server"></asp:TextBox>
                        <asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Click" Text="立即查询" CssClass="i_button2" /></td>
                </tr>
            </table>
            </div>
            <div class="intab mar_top" id="intab">
                <ul>
                    <li class="intabt2">证书管理</li>
                </ul>
                    <div class="intabc" id="intabc">
            <div class="con" style="display: block">
             <table cellpadding="0" cellspacing="0" border="0" class="edtb">
                            <thead>
                                <tr>
                                    <td id="xh" align="center" width="40">
                                        <strong>选项</strong>
                                    </td>
                                    <td align="center" width="80">
                                        <strong>权威证书</strong>
                                    </td>
                                    <td align="center" >
                                        <strong>公司名称</strong>
                                    </td>
                                    <td align="center" width="70">
                                        <strong>证书名称</strong>
                                    </td>
                                    <td align="center" width="70">
                                        <strong>发证机构</strong>
                                    </td>
                                    <td align="center" width="70">
                                        <strong>发证日期</strong>
                                    </td>
                                    <td align="center" width="70">
                                        <strong>证书有效期</strong>
                                    </td>
                                    <td align="center" width="40">
                                        <strong>编辑</strong>
                                    </td>
                                </tr>
                            </thead>
                            <tbody>
                            <asp:Repeater  ID="grdCertificate" runat="server"  > 
                    <ItemTemplate>
                        <tr>
                            <td width="40" align="center">
                                <input runat="server" value='<%# DataBinder.Eval(Container.DataItem,"ID")%>' id="chk" name="chk"
                                    type="checkbox" onmouseover="this.mouse='over'" onmouseout="this.mouse='out'" />
                            </td>
                            <td width="80" align="center">
                            <asp:Image ID="imgUrl" runat="server" ImageUrl='<%# Base.BasePage.ProcessAbsoluteUrl(Eval("URL").ToString()) %>' CssClass="table_photo" Width="80" Height="80" />
                            </td>
                            <td  align="center">
                                <%# DataBinder.Eval(Container.DataItem, "CompanyName")%>
                            </td>
                            <td align="center" width="70">
                                <%# DataBinder.Eval(Container.DataItem, "Name")%>
                            </td>
                            <td align="center" width="70">
                            <%# DataBinder.Eval(Container.DataItem, "Organization")%>
                            </td>
                            <td align="center" width="70">
                            <%# GetShortDate(DataBinder.Eval(Container.DataItem, "LicenceDate").ToString()) %>
                            </td>
                            <td align="center" width="70">
                            <%# GetShortDate(DataBinder.Eval(Container.DataItem,"ExpiryDate").ToString()) %>
                            </td>
                            <td align="center" width="40">
                           <a href='CertificateEdit.aspx?ID=<%# DataBinder.Eval(Container.DataItem, "ID")%>&UserID=<%# Eval("UserID") %>'>
                                编辑</a>
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater >
                        </tbody>
                        <tfoot>
                            <tr>
                                <td colspan="8">
                                    <p class="zi1">
                                                     <input runat="server" class="checkbox" type="checkbox" id="chkall" name="chkall" onclick="CheckMinoAll();" />
                                        全选
                                        <asp:Button ID="btnDelete" runat="server" Text="批量删除" OnClick="btnDelete_Click"  OnClientClick="return CheckSelect();return confirm('你确认要删除吗?');" CssClass="del" />
                
                                    </p>
                                    <p class="zi2">
                                        <uc1:PageNo ID="PageNo1" runat="server" />
                                    </p>
                                </td>
                            </tr>
                        </tfoot>
                        </table>
                         </div>
                         <input type="hidden" id="CheckedIDS" name="CheckedIDS" value="0" runat="server" />
           <%-- <asp:GridView ID="grdCertificate" runat="server" AutoGenerateColumns="False" CellPadding="0"
                GridLines="None" DataKeyNames="ID" Font-Bold="False" Font-Overline="False" AllowPaging="True"
                OnPageIndexChanging="grdCertificate_PageIndexChanging" Width="795" CssClass="table_main">
                <FooterStyle BackColor="#f1f1f1" Font-Bold="True" ForeColor="White" />
                <Columns>
                    <asp:TemplateField HeaderText="选项">
                        <ItemTemplate>
                            <asp:CheckBox ID="CheckBox1" runat="server" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="权威证书">
                        <ItemTemplate>
                            <asp:Image ID="imgUrl" runat="server" ImageUrl='<%# Base.BasePage.ProcessAbsoluteUrl(Eval("URL").ToString()) %>' CssClass="table_photo" Width="80" Height="80" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="CompanyName" HeaderText="公司名称"></asp:BoundField>
                    <asp:BoundField DataField="Name" HeaderText="证书名称"></asp:BoundField>
                    <asp:BoundField DataField="Organization" HeaderText="发证机构"></asp:BoundField>
                    <asp:TemplateField HeaderText="发证日期">
                        <ItemTemplate>
                            <%# GetShortDate(DataBinder.Eval(Container.DataItem, "LicenceDate").ToString()) %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="证书有效期">
                        <ItemTemplate>
                            <%# GetShortDate(DataBinder.Eval(Container.DataItem,"ExpiryDate").ToString()) %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="编辑">
                        <ItemTemplate>
                            <a href='CertificateEdit.aspx?ID=<%# DataBinder.Eval(Container.DataItem, "ID")%>&UserID=<%# Eval("UserID") %>'>
                                编辑</a>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>--%>
            </div>
            <asp:Label ID="lblMessage" runat="server" Text="Label" Visible="False"></asp:Label>
<%--            <div class="paging">
             <p><uc1:PageNo ID="PageNo1" runat="server" /></p>
                <input id="CheckBox2" name="CheckBox2" type="checkbox" onclick="SelectAll();" /> 全选 
                <asp:Button ID="btnDelete" runat="server" Text="批量删除" OnClick="btnDelete_Click" CssClass="i_button2" />
                 </div>--%>
            </div>
            </div>
    </form>
    </div>
</asp:Content>
